$(function () {
    findById();
});
function findById() {
    let id = sessionStorage.getItem("userId");
    let result = myAjax("/api/rb/user/findById", {id: id}, "get");
    if (result != null) {
        setData(result.data);
    }
}
function setData(data) {
    $("#username").val(data.username);
}
function save() {
    let data = {
        userId:sessionStorage.getItem("userId"),
        roleId:$("#role").val()
    };
    let result=myAjax("/api/rb/urr/add",data,"post");
    if(result.code===200){
        alert(result.message);
        x_admin_close();
        x_admin_father_reload();
    }else{
        alert(result.message);
    }
}